package com.xxf.basemvp.weakbase.weak

import android.os.Bundle
import android.support.v4.app.DialogFragment

/**
 * @author XXF
 * @Create Time : 2017/6/2 11:41
 */
abstract class WeakDialogFragmet<V, P : WeakPresenter<V>> : DialogFragment(), BaseView<V, P> {

    protected var mPresenter: P? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //创建Prsenter
        mPresenter = createPresenter()
        initView()
    }

    override fun onDestroyView() {
        //解除关系
        mPresenter?.detachView()
        super.onDestroyView()
    }

}
